#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->lcdNumber->display(10);
    connect(&_tid,&Thread::notify,this,&Widget::Handler);
    //启动线程
    _tid.start();
}

Widget::~Widget()
{
    delete ui;
}

void Widget::Handler()
{
    int val = ui->lcdNumber->value();
    if(val <= 0) return;
    val-=1;
    ui->lcdNumber->display(val);
}

